<?php

use App\Http\Controllers\Api\Category;
use App\Http\Controllers\Api\Courses;
use App\Http\Controllers\Api\Pay;
use App\Http\Controllers\Api\Register;
use App\Http\Controllers\Api\Swipers;
use App\Http\Controllers\Api\User;
use App\Http\Middleware\ApiCheck;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/


//发送短信验证码
Route::post("sendCode",[User::class,'sendSms']);
//获取幻灯片数据
Route::post("getSwipers",[Swipers::class,'getSwipers']);
//获取首页数据
Route::post("getAllCourse",[Swipers::class,'getAllCourse']);
//获取分类数据
Route::post("getCates",[Category::class,'getCates']);
//获取课程数据
Route::post("getCourses",[Courses::class,'getCourses']);
//发送短信
Route::post("sendSms",[User::class,'sendSms']);
//注册手机号
Route::post("register",[User::class,'register']);
//登录
Route::post("login",[User::class,'login']);

//添加token有效期核验功能
Route::group(['middleware'=>'ApiTokenCheck'],function (){
    Route::post("getCourseVideo",[Courses::class,'getCourseVideo']);
    Route::post("payH5",[Pay::class,'payH5']);
    Route::post("payApp",[Pay::class,"payApp"]);
    Route::post("payWx",[Pay::class,"payWx"]);
});





